using Needle.Utils.Collections;

namespace Needle.Bus.Configuration
{
    public class BusConfiguration
    {
        public const string XMLNamespace = Constants.NeedleBusNamespace + "configuration.xsd";
        public const string XMLSchemaVersion = "1.0";

        public BusConfiguration(string id)
        {
            _id = id;
        }

        private readonly string _id;
        public string Id
        {
            get { return _id; }
        }

        private KeyedCollection<string,StageConfiguration> _stages;
        public KeyedCollection<string, StageConfiguration> Stages
        {
            get { return _stages ?? (_stages = new KeyedCollection<string, StageConfiguration>(x => x.Id)); }
        }

        private KeyedCollection<string, MessageHandlerConfiguration> _messageHandlers;
        public KeyedCollection<string, MessageHandlerConfiguration> MessageHandlers
        {
            get { return _messageHandlers ?? (_messageHandlers = new KeyedCollection<string, MessageHandlerConfiguration>(x => x.Id)); }
        }

    }
}
